package com.app.util;

public class StringUtil {
	
	public static String getCommonLogHeader(String serverName,String empId){
		
		String commonLog = String
				.format("系统名称[%s]，操作员工[%s]"
						, serverName
						,empId);		
		return commonLog;
	}
	
	public static String nullToEmpty(Object str){
		if(str == null || str.toString().length()==0){
			return "";
		}else{
			return str.toString().trim();
		}
	}
	
	
	public static String nullToZero(String str){
		if(str == null || str.trim().length()==0){
			return "0";
		}else{
			return str.trim();
		}
	}
	
	public static boolean isEmpty(String str){
		if(str == null || str.trim().length()==0){
			return true;
		}
		return false;
	}
	
	
	public static  String appendStr(Object... objs){
		StringBuffer buffer = new StringBuffer();
		for (Object obj:objs){
			buffer.append(obj.toString());
		}
		return buffer.toString();
	}
	
	public static void main(String args[]){
		System.out.println(appendStr("abc",123,678));
	}

}
